package webservices.axis2abe;

import java.rmi.RemoteException;

import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
import org.tempuri.ServiceSoap;

import com.cb.common.webService.ClientService;

import webservices.axis2abe.ServiceStub.ABESubmit;
import webservices.axis2abe.ServiceStub.ABESubmitResponse;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		String identity="<?xml version=\"1.0\" encoding=\"utf-8\"?><Identity_1_0><ABEConnectionString>User=AGENT00;Password=ATS123;Server=192.168.100.200;Port=350;MaxPages=30;</ABEConnectionString></Identity_1_0>";
		String request="<?xml version=\"1.0\"?><ABE_AVDataset_1_4><From>CAN</From><Arrive>CSX</Arrive><Date>2012-07-25</Date><Carrier></Carrier><Time>0000</Time><StopType>D</StopType><Option>;CP</Option><MaxNum>1</MaxNum></ABE_AVDataset_1_4>";
		long startTime=System.currentTimeMillis();
		String test="";
		// TODO Auto-generated method stub
		try {
		
			ServiceStub serviceStub=new ServiceStub("http://183.63.31.25:38080/WebABE.asmx");
			ABESubmit aBESubmit=new ABESubmit();
			aBESubmit.setIdentity(identity);
			aBESubmit.setRequest(request);
			aBESubmit.setFilter("");
			ABESubmitResponse response=serviceStub.aBESubmit(aBESubmit);
			test=response.getABESubmitResult();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	
		
		/*ClientService<ServiceSoap> clientService = new ClientService<ServiceSoap>();

		ServiceSoap service = clientService.getClient("abeService.path",ServiceSoap.class);
		 test=service.abeSubmit(identity, request, "");*/
		long endTime=System.currentTimeMillis();
	    long totalSeconds = (endTime- startTime)/ 1000;
	    System.out.println(totalSeconds);
	    System.out.println(test.length());
	}

}
